Embodiments of the inventive subject matter generally relate to the field of databases, and, more particularly, to executing queries in parallel according to a deadline for query completion.
Many applications access one or more databases as part of their operation. In general, database management systems are designed to provide a quick response to requests to store or retrieve information. For example, most databases allow for parallelization of query execution, especially for applications that require access to large amounts of data. During parallel query execution, the database management system arranges for multiple threads to process portions of the query in parallel with one another. Each parallel thread processes a share (fraction) of the total data and a query coordinator thread joins the partial results provided by the parallel threads to form a final result that is returned to the user. A query optimizer may determine the number of parallel threads used for a query. The query optimizer makes decisions on how to apportion parts of the query to parallel threads with a goal of producing the result in the shortest amount of time. In other words, the degree of parallelism is calculated to minimize the overall query execution time.
While such optimization is beneficial in cases where a user or process is waiting for the results of a query, there can be a large cost in terms of resources (processors, memory etc.) that are used in order to provide the degree of parallelism utilized in current database management systems.